﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace HetmansProblem
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
       HetmansMain h = new HetmansMain();
        public MainWindow()
        {

            
            InitializeComponent();

            lst.ItemsSource = h.Board.BoardTableH;
            
        }

        private void button1_Click(object sender, RoutedEventArgs e)
        {
            h.Play();
            label2.Content = "Zakończono gre";
            List<List<string>> _tmpBoardTable = new List<List<string>>(h.Board.BoardTableH );
            for (int j = 0; j < _tmpBoardTable.Count; j++)
            {
                for (int i = 0; i < _tmpBoardTable[j].Count; i++)
                {
                    if (_tmpBoardTable[j][i]!="H")
                    {
                        _tmpBoardTable[j][i] = h.Board.BoardTablePossMov[j][i]; 
                    }
                }
            }
            lst.ItemsSource = "";
            lst.ItemsSource = _tmpBoardTable;
            
        }
    }
}
